#ifndef _SASTE_LOOP_ABSTRACT_CPP_
#define _SASTE_LOOP_ABSTRACT_CPP_

void Abstract::loop()
{
    int code;
    bool end = true;
    beginLoop();
    while (end) {
        code = getEventCode();
        eventsList::iterator it;
        for (it = events.begin(); it != events.end(); it++) {
            if ((*it)->check(code)) {
                end = (*it)->event();
            }
        }
    }
    endLoop();
}

bool Abstract::registerEvent(Event::Abstract* event)
{
    events.push_back(event);
}

#endif
